#region license
/*
 * Copyright (C) 2007 CchenSoft.com
 * 
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License 2.1 or later, as
 * published by the Free Software Foundation. See the included License.txt
 * or http://www.gnu.org/copyleft/lesser.html for details.
 * 
 * Author: Billy Zhang
 */
#endregion

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Net;
using System.IO;
using System.Web.UI.WebControls;
using CchenSoft.Portal.Model;
using CchenSoft.Portal.Registry;
using CchenSoft.Portal.Util;
using System.Web;
using System.Web.UI.HtmlControls;
using CchenSoft.Portal.Service;
using CchenSoft.Portal.Spi.Registry;
using CchenSoft.Portal.Service.Impl;

namespace CchenSoft.Portal.Web
{
    [ParseChildren(true)]
    public class ExceptionControl : ThemeControl
    {
        private string message;
        private PortletInstance instance;

        public ExceptionControl(PortletInstance instance, string message)
        {
            SkinFileName = "portlet_view.ascx";
            this.instance = instance;
            this.message = message;
        }
        //protected override 
        protected override void InitializeSkin(Control control)
        {
            //control.ID = instance.InstanceId;
            Label title = (Label)control.FindControl("title");
            if (instance != null)
            {
                title.Text = instance.Title;
            }

            Label content = (Label)control.FindControl("content");
            content.Text = message;

            ((HyperLink)control.FindControl("hlnkCfg")).Visible = false;
            ((HyperLink)control.FindControl("hlnkMax")).Visible = false;
            ((HyperLink)control.FindControl("hlnkNormal")).Visible = false;
            ((HyperLink)control.FindControl("hlnkClose")).Visible = false;
        }
    }
}
